<html>

<head>
<meta name=标题 content="">
<meta name=关键词 content="">
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 15 (filtered)">
<style>
<!--
 /* Font Definitions */
@font-face
	{font-family:"Courier New";
	panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
	{font-family:Times;
	panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
	{font-family:"Cambria Math";
	panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
	{font-family:DengXian;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:"\@DengXian";}
@font-face
	{font-family:"Microsoft YaHei";
	panose-1:2 11 5 3 2 2 4 2 2 4;}
@font-face
	{font-family:Menlo;
	panose-1:2 11 6 9 3 8 4 2 2 4;}
@font-face
	{font-family:"\@Microsoft YaHei";}
 /* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:12.0pt;
	font-family:DengXian;}
code
	{font-family:Courier;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
	{margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	text-indent:21.0pt;
	font-size:12.0pt;
	font-family:DengXian;}
p.a, li.a, div.a
	{margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	line-height:200%;
	font-size:12.0pt;
	font-family:"Microsoft YaHei";}
.MsoChpDefault
	{font-family:DengXian;}
 /* Page Definitions */
@page WordSection1
	{size:595.0pt 842.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	layout-grid:15.6pt;}
div.WordSection1
	{page:WordSection1;}
 /* List Definitions */
ol
	{margin-bottom:0cm;}
ul
	{margin-bottom:0cm;}
-->
</style>

</head>

<body lang=ZH-CN style='text-justify-trim:punctuation'>

<div class=WordSection1 style='layout-grid:15.6pt'>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-size:14.0pt;line-height:200%;font-family:"Microsoft YaHei"'>e2image</span></b></p>

<p class=MsoNormal align=left style='margin-bottom:12.0pt;text-align:left;
text-indent:21.0pt;line-height:200%;text-autospace:none'><span lang=EN-US
style='font-family:"Microsoft YaHei";color:black;vertical-align:sub'>e2Image</span><span
style='font-family:"Microsoft YaHei";color:black;vertical-align:sub'>程序将位于设备上的<span
lang=EN-US>ext2</span>、<span lang=EN-US>ext3</span>或<span lang=EN-US>ext4</span>文件系统元数据保存到由图像文件指定的文件中。通过对这些程序使用<span
lang=EN-US>-i</span>选项，<span lang=EN-US>image</span>文件可以由<span lang=EN-US>dupe2fs</span>和调试器来检查。这可以帮助专家恢复严重损坏的文件系统。</span></p>

<p class=MsoNormal align=left style='margin-bottom:12.0pt;text-align:left;
text-indent:21.0pt;line-height:200%;text-autospace:none'><span
style='font-family:"Microsoft YaHei";color:black;vertical-align:sub'>如果<span
lang=EN-US>image</span>文件是<span lang=EN-US>”-“</span>，那么<span lang=EN-US>e2image</span>的输出将被发送到标准输出，以便输出可以管道到另一个程序，如<span
lang=EN-US>gzip(1)</span>。<span lang=EN-US>(</span>请注意，目前只有在使用<span lang=EN-US>-r</span>选项创建原始<span
lang=EN-US>image</span>文件时才支持这一点，因为创建普通<span lang=EN-US>image</span>文件或<span
lang=EN-US>QCOW 2</span>映像的过程目前需要对文件进行随机访问，这不能使用管道进行。<span lang=EN-US>)</span></span></p>

<p class=MsoNormal align=left style='margin-bottom:12.0pt;text-align:left;
text-indent:21.0pt;line-height:200%;text-autospace:none'><span
style='font-family:"Microsoft YaHei";color:black;vertical-align:sub'>最好为系统上的所有文件系统创建映像文件，并定期保存分区布局<span
lang=EN-US>(</span>可以使用<span lang=EN-US>fdisk-l</span>命令生成<span lang=EN-US>)</span>。<span
lang=EN-US>image</span>文件应该存储在它所包含的数据的文件系统以外的其他文件系统上，以确保在文件系统严重损坏的情况下可以访问这些数据。</span></p>

<p class=MsoNormal align=left style='margin-bottom:12.0pt;text-align:left;
text-indent:21.0pt;line-height:200%;text-autospace:none'><span
style='font-family:"Microsoft YaHei";color:black;vertical-align:sub'>为了节省磁盘空间，<span
lang=EN-US>e2Image</span>将<span lang=EN-US>image</span>文件创建为稀疏文件，或以<span
lang=EN-US>QCOW2</span>格式创建。因此，如果需要将稀疏<span lang=EN-US>image</span>文件复制到另一个位置，则应该首先对其进行压缩，或者使用<span
lang=EN-US>GNU</span>版本的<span lang=EN-US>cp ”</span></span><span lang=EN-US> </span><span
lang=EN-US style='font-family:"Microsoft YaHei";color:black;vertical-align:
sub'>sparse=always”</span><span style='font-family:"Microsoft YaHei";
color:black;vertical-align:sub'>选项。这不适用于<span lang=EN-US>QCOW2</span>映像，它并不稀疏。</span></p>

<p class=MsoNormal align=left style='margin-bottom:12.0pt;text-align:left;
text-indent:21.0pt;line-height:200%;text-autospace:none'><span lang=EN-US
style='font-family:"Microsoft YaHei";color:black;vertical-align:sub'>ext2</span><span
style='font-family:"Microsoft YaHei";color:black;vertical-align:sub'>映像文件的大小主要取决于文件系统的大小和正在使用的<span
lang=EN-US>inode</span>数量。对于一个典型的<span lang=EN-US>10GB</span>文件系统，<span
lang=EN-US>120</span>万个节点中有<span lang=EN-US>20</span>万个节点在使用，<span lang=EN-US>image</span>文件将大约为<span
lang=EN-US>35</span>兆字节；在<span lang=EN-US>55</span>万个节点中使用<span lang=EN-US>15000</span>个节点的<span
lang=EN-US>4G</span>文件系统将产生一个<span lang=EN-US>3MB</span>的<span lang=EN-US>image</span>文件。<span
lang=EN-US>image</span>文件通常是可压缩的；占用磁盘上<span lang=EN-US>32 MB</span>空间的<span
lang=EN-US>image</span>文件通常会压缩到<span lang=EN-US>3</span>或<span lang=EN-US>4MB</span>。</span></p>

<p class=MsoNormal align=left style='margin-bottom:12.0pt;text-align:left;
text-indent:21.0pt;line-height:200%;text-autospace:none'><span
style='font-family:"Microsoft YaHei";color:black;vertical-align:sub'>此命令的适用范围：<span
lang=EN-US>RedHat</span>、<span lang=EN-US>RHEL</span>、<span lang=EN-US>Ubuntu</span>、<span
lang=EN-US>CentOS</span>、<span lang=EN-US>SUSE</span>、<span lang=EN-US>openSUSE</span>、<span
lang=EN-US>Fedora</span>。</span></p>

<p class=MsoNormal align=left style='margin-bottom:12.0pt;text-align:left;
text-indent:21.0pt;line-height:200%;text-autospace:none'><span lang=EN-US
style='font-family:"Microsoft YaHei";color:black;vertical-align:sub'>&nbsp;</span></p>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-family:"Microsoft YaHei"'>1</span></b><b><span style='font-family:
"Microsoft YaHei"'>、语法</span></b></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><b><span
lang=EN-US style='font-family:"Microsoft YaHei"'>e2image [ -rsI ] device
image-file</span></b></p>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-family:"Microsoft YaHei"'>&nbsp;</span></b></p>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-family:"Microsoft YaHei"'>2</span></b><b><span style='font-family:
"Microsoft YaHei"'>、选项列表</span></b></p>

<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 width="95%"
 style='width:95.0%;margin-left:24.1pt;border-collapse:collapse;border:none'>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  background:#E7E6E6;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>选项</span></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border:solid windowtext 1.0pt;
  border-left:none;background:#E7E6E6;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>说明</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-I</span></b></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>将文件中的元数据恢复到分区</span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-r</span></b></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>创建<span
  lang=EN-US>raw</span>格式的<span lang=EN-US>image</span></span></p>
  </td>
 </tr>
 <tr>
  <td width="28%" valign=top style='width:28.58%;border:solid windowtext 1.0pt;
  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
  style='font-family:"Microsoft YaHei"'>-Q</span></b></p>
  </td>
  <td width="71%" valign=top style='width:71.42%;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  padding:0cm 5.4pt 0cm 5.4pt'>
  <p class=MsoNormal style='line-height:200%'><span style='font-family:"Microsoft YaHei"'>创建<span
  lang=EN-US>QCOW2</span>格式的<span lang=EN-US>image</span></span></p>
  </td>
 </tr>
</table>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-family:"Microsoft YaHei"'>&nbsp;</span></b></p>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-family:"Microsoft YaHei"'>3</span></b><b><span style='font-family:
"Microsoft YaHei"'>、说明</span></b></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>1)</span><span
style='font-family:"Microsoft YaHei"'>“<span lang=EN-US>-I</span>”选项</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>“-I”</span><span
style='font-family:"Microsoft YaHei"'>选项将导致<span lang=EN-US>e2Image</span>将存储在映像文件中的元数据重新安装到设备上。它可用于在紧急情况下将文件系统元数据还原回设备。只有当其他选择失败时，才应该使用<span
lang=EN-US>”-I”</span>选项作为一种绝望措施。如果文件系统在创建<span lang=EN-US>image</span>文件后发生了更改，数据将丢失。通常，您应该首先对文件系统进行完整的映像备份，以便以后尝试其他恢复策略。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>2</span><span
style='font-family:"Microsoft YaHei"'>）“<span lang=EN-US>-r</span>”选项</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>“<span lang=EN-US>-r</span>”选项将创建一个原始<span
lang=EN-US>image</span>文件，而不是普通的<span lang=EN-US>image</span>文件。原始<span
lang=EN-US>image</span>文件与普通<span lang=EN-US>image</span>文件有两种不同之处。首先，将文件系统元数据放置在适当的位置，以便<span
lang=EN-US>e2fsck</span>、<span lang=EN-US>dupe2fs</span>、调试器等。可以直接在原始<span
lang=EN-US>image</span>文件上运行。为了尽量减少原始映像文件占用的磁盘空间，将该文件创建为稀疏文件。<span lang=EN-US>(</span>请注意使用不了解如何创建稀疏文件的实用程序复制或压缩<span
lang=EN-US>/</span>解压缩该文件；该文件将与文件系统本身一样大！<span lang=EN-US>)</span>其次，原始<span
lang=EN-US>image</span>文件还包括标准<span lang=EN-US>image</span>文件没有的间接块和目录块，尽管这在将来可能会发生变化。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>当将文件系统作为<span lang=EN-US>bug</span>报告的一部分发送给维护人员时，有时会使用原始映像文件到<span
lang=EN-US>e2fsprogs</span>。当以这种方式使用时，建议的命令如下<span lang=EN-US>(</span>用适当的设备替换<span
lang=EN-US>hda1)</span>：“<b><span lang=EN-US>e2image  -r  /dev/hda1  -  |  bzip2
 &gt;  hda1.e2i.bz2</span></b>”。这将只发送元数据信息，没有任何数据块。但是，目录块中的文件名仍然可以显示关于文件系统内容的信息，<span
lang=EN-US>bug</span>报告人员可能希望将这些信息保密。要解决此问题，可以指定“<span lang=EN-US>-s</span>”选项。这将导致<span
lang=EN-US>e2Image</span>对目录条目进行置乱，并在写入<span lang=EN-US>image</span>文件之前将目录块中任何未使用的部分清零。但是，“<span
lang=EN-US>-s</span>”选项将防止分析与散列树索引目录相关的问题</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>请注意，即使您将<span lang=EN-US>“/dev/hda 1”</span>替换为另一个原始磁盘映像或先前由<span
lang=EN-US>e2Image</span>创建的<span lang=EN-US>QCOW2</span>映像，这也是可行的。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>3</span><span
style='font-family:"Microsoft YaHei"'>）“<span lang=EN-US>-Q</span>”选项</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>“<span lang=EN-US>-Q</span>”选项将创建一个<span
lang=EN-US>QCOW2 image</span>文件，而不是普通的或原始的<span lang=EN-US>image</span>文件。<span
lang=EN-US>QCOW2 image</span>包含原始<span lang=EN-US>image</span>所做的所有信息，但是与原始<span
lang=EN-US>image</span>不同的是，它并不稀疏。<span lang=EN-US>QCOW 2</span>映像通过将数据以特殊格式存储，并将数据紧密地打包在一起，从而将磁盘空间的数量降到最低，从而避免了漏洞，同时仍然最小化了大小。</span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>为了将文件系统作为<span lang=EN-US>bug</span>报告的一部分发送给维护人员到<span
lang=EN-US>e2fsprogs</span>，请使用以下命令：“<b><span lang=EN-US>e2image  -Q  /dev/hda1
 hda1.qcow2</span>“、”<span lang=EN-US>bzip2  -z  hda1.qcow2</span></b>”。这将只发送元数据信息，没有任何数据块。但是，目录块中的文件名仍然可以显示关于文件系统内容的信息，<span
lang=EN-US>bug</span>报告人员可能希望将这些信息保密。要解决此问题，可以指定“<span lang=EN-US>-s</span>”选项。这将导致<span
lang=EN-US>e2Image</span>对目录条目进行置乱，并在写入<span lang=EN-US>image</span>文件之前将目录块中任何未使用的部分清零。但是，“<span
lang=EN-US>-s</span>”选项将防止分析与哈希树索引目录相关的问题<span lang=EN-US>.</span></span></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>请注意，<span lang=EN-US>e2Image</span>创建的<span
lang=EN-US>qcow2</span>映像是规则的<span lang=EN-US>qcow2</span>映像，可以通过知道<span
lang=EN-US>qcow2</span>格式的工具进行处理，例如<span lang=EN-US>qemu-img</span>。</span></p>

<p class=MsoNormal style='line-height:200%'><span lang=EN-US style='font-family:
"Microsoft YaHei"'>&nbsp;</span></p>

<p class=MsoNormal style='line-height:200%'><b><span lang=EN-US
style='font-family:"Microsoft YaHei"'>4</span></b><b><span style='font-family:
"Microsoft YaHei"'>、实例</span></b></p>

<p class=MsoNormal style='text-indent:21.0pt;line-height:200%'><span
style='font-family:"Microsoft YaHei"'>保存<span lang=EN-US>sdb4</span>元数据 </span></p>

<table class=a0 border=1 cellspacing=0 cellpadding=0 width="95%"
 style='width:95.0%;margin-left:24.1pt;border-collapse:collapse;border:none'>
 <tr style='height:14.9pt'>
  <td width=836 valign=top style='width:836.15pt;border:solid windowtext 1.0pt;
  background:#E7E6E6;padding:0cm 5.4pt 0cm 5.4pt;height:14.9pt'>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>[root@localhost
  ~]#<b> e2image /dev/sdb4 sdb4</b></span></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>e2image 1.41.12
  (17-May-2010)</span></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>[root@localhost
  ~]# <b>file sdb4</b></span></code></p>
  <p class=MsoNormal style='line-height:200%'><code><span lang=EN-US
  style='font-size:10.0pt;line-height:200%;font-family:Menlo'>sdb4: Linux rev
  1.0 ext2 filesystem data</span></code></p>
  </td>
 </tr>
</table>

<p class=MsoNormal style='line-height:200%'><span lang=EN-US style='font-family:
"Microsoft YaHei"'>     </span></p>

<p class=MsoNormal style='line-height:200%'><span lang=EN-US style='font-family:
"Microsoft YaHei"'>&nbsp;</span></p>

<p class=MsoNormal style='line-height:200%'><span lang=EN-US style='font-family:
"Microsoft YaHei"'>&nbsp;</span></p>

<p class=MsoNormal align=center style='text-align:center;line-height:200%'><span
lang=EN-US style='font-family:"Microsoft YaHei"'>Copyright@david 
zhytwj2018@163.com</span></p>

</div>

</body>

</html>
